/*
 ***************************************************************************
 * MediaTeK Inc.
 * 4F, No. 2 Technology	5th	Rd.
 * Science-based Industrial	Park
 * Hsin-chu, Taiwan, R.O.C.
 *
 * (c) Copyright 2002-2012, MTK.
 *
 * All rights reserved.	MediaTeK's source	code is	an unpublished work	and	the
 * use of a	copyright notice does not imply	otherwise. This	source code
 * contains	confidential trade secret material of MediaTeK Tech. Any attemp
 * or participation	in deciphering,	decoding, reverse engineering or in	any
 * way altering	the	source code	is stricitly prohibited, unless	the	prior
 * written consent of MediaTeK, Inc. is obtained.
 ***************************************************************************

	Module Name:
	omci_types.h

	Abstract:

	Revision History:
	Who			When			What
	--------	----------		----------------------------------------------
	Name		Date			Modification logs
	jq.zhu		2012/6/28	Create
*/



#ifndef _OMCI_TYPES_H_
#define _OMCI_TYPES_H_

#include <stdint.h>
#include <stdbool.h>

/* ME attribute Access type */
#define ATTR_ACCESS_R                   (0x01 << 0)
#define ATTR_ACCESS_W                   (0x01 << 1)
#define ATTR_ACCESS_SET_CREATE          (0x01 << 2)
#define ATTR_ACCESS_R_W                 (ATTR_ACCESS_R | ATTR_ACCESS_W)
#define ATTR_ACCESS_R_SET_CREATE        (ATTR_ACCESS_R | ATTR_ACCESS_SET_CREATE)	
#define ATTR_ACCESS_W_SET_CREATE        (ATTR_ACCESS_W | ATTR_ACCESS_SET_CREATE)			
#define ATTR_ACCESS_R_W_SET_CREATE      (ATTR_ACCESS_R | ATTR_ACCESS_W | ATTR_ACCESS_SET_CREATE )	

/*attribute format */
#define ATTR_FORMAT_POINTER    1
#define ATTR_FORMAT_BIT_FIELD    2
#define ATTR_FORMAT_SIGNED_INT    3
#define ATTR_FORMAT_UNSIGNED_INT    4	
#define ATTR_FORMAT_STRING    5
#define ATTR_FORMAT_ENUM    6
#define ATTR_FORMAT_TABLE    7


/*attribute supported define */
#define ATTR_FULLY_SUPPORT    1
#define ATTR_UNSUPPORT    2
#define ATTR_PART_SUPPORT    3
#define ATTR_IGNORED    4
 

#define OMCI_CREATE_ACTION_SET_VAL		0
#define OMCI_SET_ACTION_SET_VAL			1
#define OMCI_SET_TABLE_ACTION_SET_VAL	2

#define MT_OMCI_ALARM_BITMAP_LENGTH		28
#define OMCI_ALARM_RECORD_FLAG_LENGTH   (MT_OMCI_ALARM_BITMAP_LENGTH*8)


/* OMCI device ID define */
#define MT_OMCI_DEVICE_ID_BASELINE	0x0A
#define MT_OMCI_DEVICE_ID_EXTENDED	0x0B

/*OMCI ME access define*/
#define OMCI_ME_ACCESS_ONU	1
#define OMCI_ME_ACCESS_OLT	2
#define OMCI_ME_ACCESS_OLT_ONU	3

/* OMCI ME support define */
#define OMCI_ME_SUPPORT		1
#define OMCI_ME_UNSUPPORT	2
#define OMCI_ME_PARTIAL_SUPPORT	3
#define OMCI_ME_IGNORED		4

/* result and reason code */
#define OMCI_CMD_SUCCESS							0x00
#define OMCI_CMD_ERROR								0x01
#define OMCI_CMD_NOT_SUPPORT						0x02
#define OMCI_PARAM_ERROR							0x03
#define OMCI_UNKNOW_ME								0x04
#define OMCI_UNKNOW_ME_INST							0x05
#define OMCI_DEVICE_BUSY							0x06
#define OMCI_INST_EXIST								0x07
#define OMCI_ATTR_FAIL_OR_UNKNOW					0x09


/* OMCI message source indicator */
#define EXTERNAL_MSG						0x0000	
/* FROM OLT */
#define INTERNAL_MSG						0x0001    
/* FROM ONU */

#define IN
#define OUT
#define IN_OUT

#define TRUE 1
#define FALSE 0

#define	COMMITTED_IMAGE		1
#define	UNCOMMITTED_IMAGE	0
#define	ACTIVE_IMAGE		1
#define	INACTIVE_IMAGE		0
#define	VALID_IMAGE			1
#define	INVALID_IMAGE		0
 
#define OMCI_ATTR_ADMIN_STATE		("admin state")

#define 		CODE_POINT_END			0xffff


#define OMCI_FUNC_TRACE_ENTER \
    omcidbgPrintf(OMCI_DEBUG_LEVEL_TRACE,"===Enter Function: %s %d===\n",  __FUNCTION__, __LINE__)

#define OMCI_FUNC_TRACE_LEAVE \
    omcidbgPrintf(OMCI_DEBUG_LEVEL_TRACE,"===Leave Function: %s %d===\n",  __FUNCTION__, __LINE__)

#endif // _OMCI_TYPES_H_




